package com.moyu.admin.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.moyu.admin.entity.SysRole;
import com.moyu.admin.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author moyu
 * @since 2019-02-18
 */
@Controller
@RequestMapping("/admin/role")
public class SysRoleController {
  @Autowired
  private SysRoleService sysRoleService;

  @RequestMapping("/index")
  public String index() {
    return "admin/role/list";
  }

  @RequestMapping("/list")
  @ResponseBody
  public Page<SysRole> list() {
    Page<SysRole> page = sysRoleService.selectRolePage(new Page<SysRole>(0, 12));
    return page;
  }
}

